/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pobicos;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 *
 * @author marcin
 */
public class Agent implements Serializable {

    private Integer id_ = null;
    private boolean generic_ = false;
    private boolean multiple_ = false;
    private AgentType type_ = null;
    private Integer intances = 0;
    private Map<String, Double> happinessMap_ = null;
    private List<Operator> operatorsList_=null;
    private Map<Integer,Map<String,Double>> instancesMap_=null;

    public Agent() {
        generic_ = false;
        multiple_ = false;
    }

    public Agent(Integer id) {
        generic_ = false;
        multiple_ = false;
        id_ = id;
    }

    public Agent(Agent agentCopy) {
        this.id_ = agentCopy.getId();
        if (agentCopy.isGeneric()) {
            this.id_ = agentCopy.getId();
            this.generic_ = true;
        } else {
            this.generic_ = false;
        }
        if (agentCopy.isMultilpe()) {
            this.multiple_ = true;
            this.intances = agentCopy.getNumberOfInstances();
        } else {
            this.multiple_ = false;
        }
        this.type_ = agentCopy.getType();
        this.happinessMap_ = agentCopy.getHappinessMap();
        this.operatorsList_ = agentCopy.getOperatorsList();
    }

    public void setGeneric() {
        generic_ = true;
    }
    public void setType(AgentType type) {
        type_ = type;
    }
    public Integer getId() {
        return id_;
    }
    public AgentType getType() {
        return type_;
    }
    public boolean isGeneric() {
        return generic_;
    }
    public boolean isMultilpe() {
        return multiple_;
    }
    public void setMultipleMode(Integer n) {
        intances = n;
        multiple_ = true;
    }
    public void setSingleMode() {
        intances = 0;
        multiple_ = false;
        instancesMap_=null;
    }
    public Integer getNumberOfInstances() {
        return intances;
    }
    public void setHappinessMap( Map<String,Double> map) {
        happinessMap_ = map;
    }
    public  Map<String,Double> getHappinessMap() {
        return happinessMap_;
    }
    public  void  setOperatorsList(List<Operator> operatorsList) {
       operatorsList_ = operatorsList;
    }
    public  List<Operator> getOperatorsList() {
        return operatorsList_;
    }
    public  Map<Integer,Map<String,Double>> getInstacesHappMap() {
        return instancesMap_;
    }
    public void setInstacesHappMap(Map<Integer, Map<String, Double>> map) {
        instancesMap_ = map;
    }

}
